<?php
namespace app\index\model;
use think\Model;

class EcmsNews extends Model{

    /**
     * 根据id查询新闻数据
     * @param  [type] $id [description]
     * @return [type]     [description]
     */
    public function content($id = null){

        if(!is_numeric($id)){
            return false;
        }
        $news = "SELECT a.id,newstime,smalltext,newstext,title,befrom,username,isurl,titleurl,keyboard FROM `www_ecms_news` `a` INNER JOIN `www_ecms_news_data_1` `b` ON `b`.`id`=`a`.`id` WHERE `a`.`id` = ".$id." LIMIT 1";

        $res = sql_to_data($news);

        return $res;
    }

}
